using CloudStorage.API;
using CloudStorage.API.Blobs;
using CloudStorage.API.Entities;
using CloudStorage.API.Messages;

namespace CloudStorage.Factories
{
	/// <summary>
	/// Functionality for accessing the Cloud Storage
	/// </summary>
	public interface ICloudStorageDataContextFactory
	{
		/// <summary>
		/// Retreives the default account queue by name
		/// </summary>
		/// <param name="queueName">name of the Queue to fetch</param>
		/// <returns><see cref="IMessageQueueDataContext"/></returns>
		IMessageQueueDataContext GetMessageQueue(string queueName);

		/// <summary>
		/// Retreives a queue by name
		/// </summary>
		/// <param name="storageAccountInfo">Account to access</param>
		/// <param name="queueName">name of the Queue to fetch</param>
		/// <returns><see cref="IMessageQueueDataContext"/></returns>
		IMessageQueueDataContext GetMessageQueue(IStorageAccountInfo storageAccountInfo, string queueName);

		/// <summary>
		/// Retreives a blob container by name
		/// </summary>
		/// <param name="containerName">name of the Container to fetch</param>
		/// <returns><see cref="IBlobContainerDataContext"/></returns>
		IBlobContainerDataContext GetBlobContainer(string containerName);

		/// <summary>
		/// Retreives a blob container by name
		/// </summary>
		/// <param name="containerName">name of the Container to fetch</param>
		/// <param name="storageAccountInfo">Account to access</param>
		/// <returns><see cref="IBlobContainerDataContext"/></returns>
		IBlobContainerDataContext GetBlobContainer(IStorageAccountInfo storageAccountInfo, string containerName);

		/// <summary>
		/// Retreives a entity data context for the type of entity supplied
		/// </summary>
		/// <returns><see cref="IEntityTableDataContext"/></returns>
		IEntityTableDataContext GetEntityTable<TEntity>() where TEntity : IEntity;

		/// <summary>
		/// Retreives a entity data context for the type of entity supplied
		/// </summary>
		/// <param name="storageAccountInfo">Account to access</param>
		/// <returns><see cref="IEntityTableDataContext"/></returns>
		IEntityTableDataContext GetEntityTable<TEntity>(IStorageAccountInfo storageAccountInfo) where TEntity : IEntity;
	}
}